﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMathLibrary.Interfaces.Web.Twitter
{
    /// <summary>
    /// This class represents a twitter user.
    /// </summary>
    [Serializable]
    public class User : IUser
    {
        /// <summary>
        /// The id information of the user.
        /// </summary>
        private string id;

        /// <summary>
        /// The name information of the user.
        /// </summary>
        private string name;

        /// <summary>
        /// The screenName information of the user.
        /// </summary>
        private string screenName;

        /// <summary>
        /// The location information of the user.
        /// </summary>
        private string location;

        /// <summary>
        /// The description information of the user.
        /// </summary>
        private string description;

        /// <summary>
        /// The profileImageUrl information of the user.
        /// </summary>
        private string profileImageUrl;

        /// <summary>
        /// The url information of the user.
        /// </summary>
        private string url;

        /// <summary>
        /// The protectedStatus information of the user.
        /// </summary>
        private bool protectedStatus;

        /// <summary>
        /// The followersCount information of the user.
        /// </summary>
        private int followersCount;

        /// <summary>
        /// The profileBackgroundColor information of the user.
        /// </summary>
        private string profileBackgroundColor;

        /// <summary>
        /// The profileTextColor information of the user.
        /// </summary>
        private string profileTextColor;

        /// <summary>
        /// The profileLinkColor information of the user.
        /// </summary>
        private string profileLinkColor;

        /// <summary>
        /// The profileSidebarFillColor information of the user.
        /// </summary>
        private string profileSidebarFillColor;

        /// <summary>
        /// The profileSidebarBorderColor information of the user.
        /// </summary>
        private string profileSidebarBorderColor;

        /// <summary>
        /// The friendsCount information of the user.
        /// </summary>
        private int friendsCount;

        /// <summary>
        /// The createdAt information of the user.
        /// </summary>
        private string createdAt;

        /// <summary>
        /// The favouritesCount information of the user.
        /// </summary>
        private int favouritesCount;

        /// <summary>
        /// The utcOffset information of the user.
        /// </summary>
        private string utcOffset;

        /// <summary>
        /// The timeZone information of the user.
        /// </summary>
        private string timeZone;

        /// <summary>
        /// The profileBackgroundImageUrl information of the user.
        /// </summary>
        private string profileBackgroundImageUrl;

        /// <summary>
        /// The profileBackgroundTile information of the user.
        /// </summary>
        private bool profileBackgroundTile;

        /// <summary>
        /// The statusesCount information of the user.
        /// </summary>
        private int statusesCount;

        /// <summary>
        /// The notifications information of the user.
        /// </summary>
        private string notifications;

        /// <summary>
        /// The verified information of the user.
        /// </summary>
        private bool verified;

        /// <summary>
        /// Initializes a new instance of the <see cref="User"/> class.
        /// </summary>
        public User()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="User"/> class.
        /// </summary>
        /// <param name="id">The id information of the user.</param>
        /// <param name="name">The name information of the user.</param>
        /// <param name="screenName">The screenname information of the user.</param>
        /// <param name="location">The location information of the user.</param>
        /// <param name="description">The description information of the user.</param>
        /// <param name="profileImageUrl">The profileImageUrl information of the user.</param>
        /// <param name="url">The url information of the user.</param>
        /// <param name="protectedStatus">The protectedStatus information of the user.</param>
        /// <param name="followersCount">The followersCount information of the user.</param>
        /// <param name="profileBackgroundColor">The profileBackgroundColor information of the user.</param>
        /// <param name="profileTextColor">The profileTextColor information of the user.</param>
        /// <param name="profileLinkColor">The profileLinkColor information of the user.</param>
        /// <param name="profileSidebarFillColor">The profileSidebarFillColor information of the user.</param>
        /// <param name="profileSidebarBorderColor">The profileSidebarBorderColor information of the user.</param>
        /// <param name="friendsCount">The friendsCount information of the user.</param>
        /// <param name="createdAt">The createdAt information of the user.</param>
        /// <param name="favouritesCount">The favouritesCount information of the user.</param>
        /// <param name="utcOffset">The utcOffset information of the user.</param>
        /// <param name="timeZone">The timeZone information of the user.</param>
        /// <param name="profileBackgroundImageUrl">The profileBackgroundImageUrl information of the user.</param>
        /// <param name="profileBackgroundTile">The profileBackgroundTile information of the user.</param>
        /// <param name="statusesCount">The statusesCount information of the user.</param>
        /// <param name="notifications">The notifications information of the user.</param>
        /// <param name="verified">The verified information of the user.</param>
        public User(string id, string name, string screenName, string location, string description,
                    string profileImageUrl, string url, bool protectedStatus, int followersCount,
                    string profileBackgroundColor, string profileTextColor, string profileLinkColor,
                    string profileSidebarFillColor, string profileSidebarBorderColor, int friendsCount, string createdAt,
                    int favouritesCount, string utcOffset, string timeZone, string profileBackgroundImageUrl,
                    bool profileBackgroundTile, int statusesCount, string notifications, bool verified)
        {
            this.id = id;
            this.name = name;
            this.screenName = screenName;
            this.location = location;
            this.description = description;
            this.profileImageUrl = profileImageUrl;
            this.url = url;
            this.protectedStatus = protectedStatus;
            this.followersCount = followersCount;
            this.profileBackgroundColor = profileBackgroundColor;
            this.profileTextColor = profileTextColor;
            this.profileLinkColor = profileLinkColor;
            this.profileSidebarFillColor = profileSidebarFillColor;
            this.profileSidebarBorderColor = profileSidebarBorderColor;
            this.friendsCount = friendsCount;
            this.createdAt = createdAt;
            this.favouritesCount = favouritesCount;
            this.utcOffset = utcOffset;
            this.timeZone = timeZone;
            this.profileBackgroundImageUrl = profileBackgroundImageUrl;
            this.profileBackgroundTile = profileBackgroundTile;
            this.statusesCount = statusesCount;
            this.notifications = notifications;
            this.verified = verified;
        }

        /// <summary>
        /// Gets or sets the id information of the user.
        /// </summary>
        /// <value>The id information of the user.</value>
        public string Id
        {
            get { return id; }
            set { id = value; }
        }

        /// <summary>
        /// Gets or sets the name information of the user.
        /// </summary>
        /// <value>The name information of the user.</value>
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        /// <summary>
        /// Gets or sets the screenName information of the user.
        /// </summary>
        /// <value>The screenName information of the user.</value>
        public string ScreenName
        {
            get { return screenName; }
            set { screenName = value; }
        }

        /// <summary>
        /// Gets or sets the location information of the user.
        /// </summary>
        /// <value>The location information of the user.</value>
        public string Location
        {
            get { return location; }
            set { location = value; }
        }

        /// <summary>
        /// Gets or sets the description information of the user.
        /// </summary>
        /// <value>The description information of the user.</value>
        public string Description
        {
            get { return description; }
            set { description = value; }
        }

        /// <summary>
        /// Gets or sets the profileImageUrl information of the user.
        /// </summary>
        /// <value>The profileImageUrl information of the user.</value>
        public string ProfileImageUrl
        {
            get { return profileImageUrl; }
            set { profileImageUrl = value; }
        }

        /// <summary>
        /// Gets or sets the url information of the user.
        /// </summary>
        /// <value>The url information of the user.</value>
        public string Url
        {
            get { return url; }
            set { url = value; }
        }

        /// <summary>
        /// Gets or sets the protectedStatus information of the user.
        /// </summary>
        /// <value>The protectedStatus information of the user.</value>
        public bool ProtectedStatus
        {
            get { return protectedStatus; }
            set { protectedStatus = value; }
        }

        /// <summary>
        /// Gets or sets the followersCount information of the user.
        /// </summary>
        /// <value>The followersCount information of the user.</value>
        public int FollowersCount
        {
            get { return followersCount; }
            set { followersCount = value; }
        }

        /// <summary>
        /// Gets or sets the profileBackgroundColor information of the user.
        /// </summary>
        /// <value>The profileBackgroundColor information of the user.</value>
        public string ProfileBackgroundColor
        {
            get { return profileBackgroundColor; }
            set { profileBackgroundColor = value; }
        }

        /// <summary>
        /// Gets or sets the profileTextColor information of the user.
        /// </summary>
        /// <value>The profileTextColor information of the user.</value>
        public string ProfileTextColor
        {
            get { return profileTextColor; }
            set { profileTextColor = value; }
        }

        /// <summary>
        /// Gets or sets the profileLinkColor information of the user.
        /// </summary>
        /// <value>The profileLinkColor information of the user.</value>
        public string ProfileLinkColor
        {
            get { return profileLinkColor; }
            set { profileLinkColor = value; }
        }

        /// <summary>
        /// Gets or sets the profileSidebarFillColor information of the user.
        /// </summary>
        /// <value>The profileSidebarFillColor information of the user.</value>
        public string ProfileSidebarFillColor
        {
            get { return profileSidebarFillColor; }
            set { profileSidebarFillColor = value; }
        }

        /// <summary>
        /// Gets or sets the profileSidebarBorderColor information of the user.
        /// </summary>
        /// <value>The profileSidebarBorderColor information of the user.</value>
        public string ProfileSidebarBorderColor
        {
            get { return profileSidebarBorderColor; }
            set { profileSidebarBorderColor = value; }
        }

        /// <summary>
        /// Gets or sets the friendsCount information of the user.
        /// </summary>
        /// <value>The friendsCount information of the user.</value>
        public int FriendsCount
        {
            get { return friendsCount; }
            set { friendsCount = value; }
        }

        /// <summary>
        /// Gets or sets the createdAt information of the user.
        /// </summary>
        /// <value>The createdAt information of the user.</value>
        public string CreatedAt
        {
            get { return createdAt; }
            set { createdAt = value; }
        }

        /// <summary>
        /// Gets or sets the favouritesCount information of the user.
        /// </summary>
        /// <value>The favouritesCount information of the user.</value>
        public int FavouritesCount
        {
            get { return favouritesCount; }
            set { favouritesCount = value; }
        }

        /// <summary>
        /// Gets or sets the utcOffset information of the user.
        /// </summary>
        /// <value>The utcOffset information of the user.</value>
        public string UtcOffset
        {
            get { return utcOffset; }
            set { utcOffset = value; }
        }

        /// <summary>
        /// Gets or sets the timeZone information of the user.
        /// </summary>
        /// <value>The timeZone information of the user.</value>
        public string TimeZone
        {
            get { return timeZone; }
            set { timeZone = value; }
        }

        /// <summary>
        /// Gets or sets the profileBackgroundImageUrl information of the user.
        /// </summary>
        /// <value>The profileBackgroundImageUrl information of the user.</value>
        public string ProfileBackgroundImageUrl
        {
            get { return profileBackgroundImageUrl; }
            set { profileBackgroundImageUrl = value; }
        }

        /// <summary>
        /// Gets or sets the profileBackgroundTile information of the user.
        /// </summary>
        /// <value>The profileBackgroundTile information of the user.</value>
        public bool ProfileBackgroundTile
        {
            get { return profileBackgroundTile; }
            set { profileBackgroundTile = value; }
        }

        /// <summary>
        /// Gets or sets the statusesCount information of the user.
        /// </summary>
        /// <value>The statusesCount information of the user.</value>
        public int StatusesCount
        {
            get { return statusesCount; }
            set { statusesCount = value; }
        }

        /// <summary>
        /// Gets or sets the notifications information of the user.
        /// </summary>
        /// <value>The notifications information of the user.</value>
        public string Notifications
        {
            get { return notifications; }
            set { notifications = value; }
        }

        /// <summary>
        /// Gets or sets the verified information of the user.
        /// </summary>
        /// <value>The verified information of the user.</value>
        public bool Verified
        {
            get { return verified; }
            set { verified = value; }
        }

        /// <summary>
        /// Compares the current user instance to another one.
        /// </summary>
        /// <param name="compare">The instance to compare.</param>
        /// <returns>True if the values of the current instance and the specified instance are equal otherwise, false.</returns>
        public bool CompareTo(User compare)
        {
            return (this.id == compare.Id) && (this.name == compare.Name) && (this.screenName == compare.ScreenName) &&
                   (this.location == compare.Location) && (this.description == compare.Description) &&
                   (this.profileImageUrl == compare.ProfileImageUrl) && (this.url == compare.Url) &&
                   (this.protectedStatus == compare.ProtectedStatus) && (this.followersCount == compare.FollowersCount) &&
                   (this.profileBackgroundColor == compare.ProfileBackgroundColor) &&
                   (this.profileTextColor == compare.ProfileTextColor) &&
                   (this.profileLinkColor == compare.ProfileLinkColor) &&
                   (this.profileSidebarFillColor == compare.ProfileSidebarFillColor) &&
                   (this.profileSidebarBorderColor == compare.ProfileSidebarBorderColor) &&
                   (this.friendsCount == compare.FriendsCount) && (this.createdAt == compare.CreatedAt) &&
                   (this.favouritesCount == compare.FavouritesCount) && (this.utcOffset == compare.UtcOffset) &&
                   (this.timeZone == compare.TimeZone) &&
                   (this.profileBackgroundImageUrl == compare.ProfileBackgroundImageUrl) &&
                   (this.profileBackgroundTile == compare.ProfileBackgroundTile) &&
                   (this.statusesCount == compare.StatusesCount) && (this.notifications == compare.Notifications) &&
                   (this.verified == compare.Verified);
        }

        /// <summary>
        /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
        /// </summary>
        /// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>.</param>
        /// <returns>
        /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
        /// </returns>
        /// <exception cref="T:System.NullReferenceException">The <paramref name="obj"/> parameter is null.</exception>
        public override bool Equals(object obj)
        {
            return base.Equals(obj);
        }

        /// <summary>
        /// Serves as a hash function for a particular type.
        /// </summary>
        /// <returns>
        /// A hash code for the current <see cref="T:System.Object"/>.
        /// </returns>
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        /// <summary>
        /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
        /// </returns>
        public override string ToString()
        {
            String result = "";

            result += "id=" + this.id + ";";
            result += "name=" + this.name + ";";
            result += "screenName=" + this.screenName + ";";
            result += "location=" + this.location + ";";
            result += "description=" + this.description + ";";
            result += "profileImageUrl=" + this.profileImageUrl + ";";
            result += "url=" + this.url + ";";
            result += "protected=" + this.protectedStatus + ";";
            result += "followersCount=" + this.followersCount + ";";
            result += "profileBackgroundColor=" + this.profileBackgroundColor + ";";
            result += "profileTextColor=" + this.profileTextColor + ";";
            result += "profileLinkColor=" + this.profileLinkColor + ";";
            result += "profileSidebarFillColor=" + this.profileSidebarFillColor + ";";
            result += "profileSidebarBorderColor=" + this.profileSidebarBorderColor + ";";
            result += "friendsCount=" + this.friendsCount + ";";
            result += "createdAt=" + this.createdAt + ";";
            result += "favouritesCount=" + this.favouritesCount + ";";
            result += "utcOffset=" + this.utcOffset + ";";
            result += "timeZone=" + this.timeZone + ";";
            result += "profileBackgroundImageUrl=" + this.profileBackgroundImageUrl + ";";
            result += "profileBackgroundTile=" + this.profileBackgroundTile + ";";
            result += "statusesCount=" + this.statusesCount + ";";
            result += "notifications=" + this.notifications + ";";
            result += "verified=" + this.verified + ";";

            return result;
        }
    }
}